﻿<%@ Page Title="" Language="VB" MasterPageFile="~/MainLayout.master" AutoEventWireup="false" CodeFile="stransstatus.aspx.vb" Inherits="stransstatus" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <script type="text/javascript" src="scripts/overlib.js"></script>
<asp:Label ID="lblStaffUID" runat="server" Visible="false" />
<asp:Label ID="lblStaffType" runat="server" Visible="false" />
<asp:Label ID="lblTransUID" runat="server" Visible="false" />
<asp:Label ID="lblPropertyUID" runat="server" Visible="false" />
    <div >
    <h1>Update Transaction Status</h1>
<hr />
<div  runat="server" id="divError" class="msg-box-error" visible="false">
        <span class="title">Error</span><br />
        <asp:Label ID="lblMsgError" runat="server" Text="ERROR" /><br/>
</div>
<div  runat="server" id="divSuccessful" class="msg-box-success" visible="false">
        <span class="title">Successful</span><br />
        <asp:Label ID="lblMsgSuccessful" runat="server" Text="Success" /><br/>   
</div>
<p><%--Description of the page--%></p>
<div class="General-info-Container">
<table width="100%"><tr><td class="General-info-title" style="width:150px;"><h3>General Information</h3></td><td><div class="General-info-title-line"></div></td></tr></table>
    <table  cellpadding="0" cellspacing="5" width="100%">
    	
        <tr valign="top">
            <td valign="top" >
                 <div  >
                     <table class="General-info-table " id="divContentGeneral" cellpadding="0" cellspacing="0">
                        <tr>
                            <th scope="row" >Address :</th>
                            <td><asp:Label ID="lblAddress" runat="server" Font-Size="12px" /></td>
                        </tr>
                        <tr id="TRProject" runat="server">
                            <th scope="row" >Project :</th>
                            <td><asp:Label ID="lblProject" runat="server" Font-Size="12px" /></td>
                        </tr>
                        <tr>
                            <th scope="row" >Property Type :</th>
                            <td><asp:Label ID="lblPropertyType" runat="server" Font-Size="12px" /></td>
                        </tr>
                        <tr>
                            <th scope="row" >LA(SQ FT) :</th>
                            <td><asp:Label ID="lblLASQFT" runat="server" Font-Size="12px" /></td>
                        </tr>
                        <tr>
                            <th scope="row" >BU(SQ FT) :</th>
                            <td><asp:Label ID="lblBUSQFT" runat="server" Font-Size="12px" /></td>
                        </tr>
                     </table>
                </div>
            </td>
        </tr>
        <tr>
          <td colspan="2"></td></tr>
    </table>
</div>

<div class="General-info-Container">
<table width="100%"><tr><td class="General-info-title" style="width:180px;"><h3>Transaction Information</h3></td><td><div class="General-info-title-line"></div></td></tr></table>
    <table  cellpadding="0" cellspacing="5" width="100%">
        
        <tr valign="top">
            <td valign="top" >
                <div>
                    <table class="General-info-table " cellpadding="0" cellspacing="0" style="width:100%;">
                        <tr>
                            <th scope="row" style="width:250px;">Transact Type :</th>
                            <td>
                                <Asp:label ID="lblTransType" runat="server" Font-Size="12px" />
                            </td>
                        </tr>
                        <tr>
                            <th scope="row">Lister :</th>
                            <td>
                                <asp:Label ID="lblLister" runat="server" Font-Size="12px" />
                                <asp:Label ID="lblhidListerId" runat="server" Visible="false" Font-Size="12px" />
                            </td>
                        </tr>
                        <tr>
                            <th scope="row">Transactor :</th>
                            <td>
                                <asp:Label ID="lblTransactor" runat="server" Font-Size="12px" />
                                <asp:Label ID="lblhidTransactorId" runat="server" Visible="false" Font-Size="12px" /></td>
                        </tr>
                         <tr id="CoBroke" runat="server">
                            <th scope="row" >Co-Broke :</th>
                            <td>
                                <asp:Label ID="lblCoBroke" runat="server" onmouseout="return nd();" style="cursor: pointer;" Font-Size="12px" />
                                <%--co-broke details--%>
                                    <asp:Label ID="lblhidCoBrokeId" runat="server" Visible="false" Font-Size="12px" />
                                    <asp:Label ID="lblhidCoBrokeAgencyName" runat="server" Visible="false" Font-Size="12px" />
                                    <asp:Label ID="lblhidCoBrokePhone" runat="server" Visible="false" Font-Size="12px" />
                                    <asp:Label ID="lblhidCoBrokeMobile" runat="server" Visible="false" Font-Size="12px" />
                                    <asp:Label ID="lblhidCoBrokeFax" runat="server" Visible="false" Font-Size="12px" />
                                    <asp:Label ID="lblhidCoBrokeEmail" runat="server" Visible="false" Font-Size="12px" />
                            </td>
                        </tr>
                        <tr>
                            <th scope="row">Transaction Date :</th>
                            <td valign="top"><asp:Label ID="lblTransactDate" runat="server" Font-Size="12px" /></td>
                                
                        </tr>
                        <tr>
                            <th scope="row">Remark :</th>
                            <td valign="top"><asp:Label ID="lblRemark" runat="server" Font-Size="12px" /></td>
                        </tr>
                        <tr>
                            <th scope="row" >Transacted Price :</th>
                            <td><asp:Label ID="lblTransactedPrice" runat="server" Font-Size="12px" /></td>
                        </tr>
                        <tr>
                            <th scope="row" >Requisition :</th>
                            <td><asp:Label ID="lblRequisition" runat="server" Font-Size="12px" /></td>
                        </tr>                      
                    </table>
                </div>
            </td>
        </tr>
        <tr>
            <td colspan="2"></td>
        </tr>
    </table>
</div>

<div class="General-info-Container">
<table width="100%"><tr><td class="General-info-title" style="width:150px;"><h3>Transaction Status</h3></td><td><div class="General-info-title-line"></div></td></tr></table>
    <table  cellpadding="0" cellspacing="5" width="100%">
        
        <tr valign="top">
            <td valign="top">
                <div >
                    <asp:Label ID="lblPendingSigning" runat="server" Text="Pending Signing" class="SecondaryTitle"/>
                    <table class="General-info-table " id="Table1" cellpadding="0" cellspacing="0">
                        <tr>
                            <th scope="row">S & P Date :</th>
                            <td>
                                <asp:TextBox ID="txtSPDate1" runat="server" onKeyPress="javascript: return false;" onPaste="javascript: return false;" />
                                <asp:ImageButton runat="Server" ID="imgSNPDateCal" AlternateText="Click to show calendar" ImageUrl="~/images/style01/Btn-calendar.png" />
                                <cc1:CalendarExtender ID="ceSNPDate" runat="server" Format="dd-MMM-yyyy" TargetControlID="txtSPDate1" PopupButtonID="imgSNPDateCal" />
                                <span style="color: Red">*</span>
                                <asp:RequiredFieldValidator ID="rfvtxtSPDate1" ControlToValidate="txtSPDate1"
                                    SetFocusOnError="true" runat="server" ValidationGroup="gSave" ErrorMessage="<br />Required"
                                    ForeColor="Red" Display="Dynamic" Enabled="false" CssClass="ErrorMsg" />
                            </td>
                        </tr>
                        <tr>
                            <th scope="row">Actual Sign Date :</th>
                            <td>
                                <asp:TextBox ID="txtSignDate" runat="server" onKeyPress="javascript: return false;" onPaste="javascript: return false;" />
                                <asp:ImageButton runat="Server" ID="imgSignDateCal" AlternateText="Click to show calendar" ImageUrl="~/images/style01/Btn-calendar.png" />
                                <cc1:CalendarExtender ID="ceSignDate" runat="server" Format="dd-MMM-yyyy" TargetControlID="txtSignDate" PopupButtonID="imgSignDateCal" />
                                <span style="color: Red">*</span>
                                <asp:RequiredFieldValidator ID="rfvtxtSignDate" ControlToValidate="txtSignDate"
                                    SetFocusOnError="true" runat="server" ValidationGroup="gSave" ErrorMessage="<br />Required"
                                    ForeColor="Red" Display="Dynamic" Enabled="false" CssClass="ErrorMsg"/>
                            </td>
                        </tr>
                        <tr>
                            <th scope="row" valign="top">Remark :</th>
                            <td><asp:TextBox ID="txtSignRemark" runat="server" TextMode="MultiLine" Height="100px" /></td>
                        </tr>
                        <tr>
                            <th scope="row">Completed :</th>
                            <td>
                                <asp:CheckBox ID="chkSignComplete" runat="server" onClick="checkVisible('Sign')" />
                                <asp:Label ID="lblSignRemark" runat="server" Font-Size="12px" />
                            </td>
                        </tr>
                    </table>
                    <br />
                    <asp:Panel ID="pnlCollection" runat="server">
                    <asp:Label ID="lblPendingCollection" runat="server" Text="Pending Collection" class="SecondaryTitle"/>
                    <table class="General-info-table " id="PendingCollection" cellpadding="0" cellspacing="0">
                        <tr>
                            <th scope="row">Actual Collection Date :</th>
                            <td>
                                <asp:TextBox ID="txtCollectDate" runat="server" onKeyPress="javascript: return false;" onPaste="javascript: return false;" />
                                <asp:ImageButton runat="Server" ID="imgCollectDateCal" ImageUrl="~/images/style01/Btn-calendar.png" AlternateText="Click to show calendar"  />
                                <cc1:CalendarExtender ID="cpeCollectDate" runat="server" Format="dd-MMM-yyyy" TargetControlID="txtCollectDate" PopupButtonID="imgCollectDateCal" />
                                <span style="color: Red">*</span>
                                <asp:RequiredFieldValidator ID="rfvtxtCollectDate" ControlToValidate="txtCollectDate"
                                    SetFocusOnError="true" runat="server" ValidationGroup="gSave" ErrorMessage="<br />Required"
                                    ForeColor="Red" Display="Dynamic" Enabled="false"  CssClass="ErrorMsg"/>
                            </td>
                        </tr>
                        <tr>
                            <th scope="row">Collected Amt :</th>
                            <td>
                                RM<asp:TextBox ID="txtCollectAmt" runat="server" 
                                    onkeypress="return isNumberKey(event)" onpaste="return false;" Text="0.00" 
                                    ReadOnly="True" />
                                <span style="color: Red">*</span>
                                <asp:RequiredFieldValidator ID="rfvtxtCollectAmt" ControlToValidate="txtCollectAmt"
                                    SetFocusOnError="true" runat="server" ValidationGroup="gSave" ErrorMessage="<br />Required"
                                    ForeColor="Red" Display="Dynamic" Enabled="false" CssClass="ErrorMsg"/>                                    
                            </td>
                        </tr>
                        </table>
                        <table>
                        <tr>
                        <asp:ListView ID="ListView1" runat="server" DataSourceID="ObjectDataSource1"  
                                InsertItemPosition="LastItem" EnableModelValidation="True" 
                                DataKeyNames="Id">
                            <EditItemTemplate>
                                <tr style="background-color: #008A8C; color: #FFFFFF;">

                                        <asp:TextBox ID="IdTextBox" runat="server" Text='<%# Bind("Id") %>' Visible="false" />

                                        <asp:TextBox ID="TransactionIdTextBox" runat="server" 
                                            Text='<%# Bind("TransactionId") %>' Visible="false"/>

                                    <td>
                                            <asp:DropDownList ID="DropDownList1" runat="server" DataTextField='<%# Bind("CollectionType") %>'>
                                            <asp:ListItem>Vendor</asp:ListItem>
                                            <asp:ListItem>Purchaser</asp:ListItem>
                                            </asp:DropDownList>
                                    </td>
                                    <td>

                                <asp:TextBox ID="CollectdateTextBox" runat="server" Text='<%# Bind("Collectdate") %>' onKeyPress="javascript: return false;" onPaste="javascript: return false;" />
                                <asp:ImageButton runat="Server" ID="imgCollectDateCal" ImageUrl="~/images/style01/Btn-calendar.png" AlternateText="Click to show calendar"  />
                                <cc1:CalendarExtender ID="cpeCollectDate" runat="server" Format="dd-MMM-yyyy" TargetControlID="CollectdateTextBox" PopupButtonID="imgCollectDateCal" />
                                <span style="color: Red">*</span>
                                <asp:RequiredFieldValidator ID="rfvtxtCollectDate" ControlToValidate="CollectdateTextBox"
                                    SetFocusOnError="true" runat="server" ValidationGroup="editlv" ErrorMessage="<br />Required"
                                    ForeColor="Red" Display="Dynamic" Enabled="false"  CssClass="ErrorMsg"/>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="AmountTextBox" runat="server" onkeypress="return isNumberKey(event)" onpaste="return false;" Text='<%# Bind("Amount") %>' />
                                        <span style="color: Red">* Enter valid amount</span>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="RemarkTextBox" runat="server" Text='<%# Bind("Remark") %>' />
                                    </td>
                                    <td>
                                        <asp:Label ID="TransactorTextBox" runat="server" 
                                            Text='<%# Eval("Transactor") %>' />
                                    </td>
                                    <td>
                                        <asp:Button ID="UpdateButton" runat="server" CommandName="Update" 
                                            Text="Update" ValidationGroup="editlv"/>
                                        <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                                            Text="Cancel" />
                                    </td>
                                </tr>
                            </EditItemTemplate>
                            <EmptyDataTemplate>
                                <table runat="server" 
                                    style="background-color: #FFFFFF;border-collapse: collapse;border-color: #999999;border-style:none;border-width:1px;">
                                    <tr>
                                        <td>
                                            No data was returned.</td>
                                    </tr>
                                </table>
                            </EmptyDataTemplate>
                            <InsertItemTemplate>
                                <tr style="">
                                        <asp:TextBox ID="IdTextBox" runat="server" Text='<%# Eval("Id") %>'  Visible="false"/>
                                        <asp:TextBox ID="TransactionIdTextBox" runat="server" 
                                            Text='<%# Bind("TransactionId") %>'  Visible="false"/>
                                    <td>
                                            <asp:DropDownList ID="DropDownList1" runat="server" DataTextField='<%# Bind("CollectionType") %>' >
                                            <asp:ListItem>Vendor</asp:ListItem>
                                            <asp:ListItem>Purchaser</asp:ListItem>
                                            </asp:DropDownList>
                                    </td>
                                    <td>
                                        
                                <asp:TextBox ID="CollectdateTextBox" runat="server" Text='<%# Bind("Collectdate") %>' onKeyPress="javascript: return false;" onPaste="javascript: return false;" />                                
                                <asp:ImageButton runat="Server" ID="imgCollectDateCal" ImageUrl="~/images/style01/Btn-calendar.png" AlternateText="Click to show calendar"  />
                                <cc1:CalendarExtender ID="cpeCollectDate" runat="server" Format="dd-MMM-yyyy" TargetControlID="CollectdateTextBox" PopupButtonID="imgCollectDateCal" />
                                <span style="color: Red">*</span>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="RequiredFieldValidator" ControlToValidate="CollectdateTextBox" Text="*Required" ValidationGroup="insertlv"></asp:RequiredFieldValidator>
                                <asp:RequiredFieldValidator ID="rfvtxtCollectDate" ControlToValidate="CollectdateTextBox"
                                    SetFocusOnError="true" runat="server"  ErrorMessage="<br />Required Date"
                                    ForeColor="Red" Display="Dynamic" Enabled="False"  CssClass="ErrorMsg"/>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="AmountTextBox" runat="server" Text='<%# Bind("Amount") %>' onkeypress="return isNumberKey(event)" onpaste="return false;" CausesValidation="False" />
                                        <span style="color: Red">* Enter valid amount</span>
                                        <asp:RequiredFieldValidator
                                            ID="RequiredFieldValidator1" runat="server" ErrorMessage="RequiredFieldValidator" ControlToValidate="AmountTextBox" SetFocusOnError="True" Text="Please enter a valid amount!" Enabled="False"></asp:RequiredFieldValidator>
                                        <asp:RangeValidator
                                            ID="RangeValidator1" runat="server" ErrorMessage="RangeValidator" MinimumValue="0" MaximumValue="999999999" ControlToValidate="AmountTextBox" Text="Please enter valid amount!" Enabled="False"></asp:RangeValidator>                                        
                                    </td>


                                    <td>
                                        <asp:TextBox ID="RemarkTextBox" runat="server" Text='<%# Bind("Remark") %>' />
                                    </td>
                                    <td>
                                        <asp:Label ID="TransactorTextBox" runat="server" 
                                            Text='<%# Eval("Transactor") %>' />
                                    </td>
                                    <td>
                                        <asp:Button ID="InsertButton" runat="server" CommandName="Insert" 
                                            Text="Insert"  ValidationGroup="insertlv"/>
                                        <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                                            Text="Clear" />
                                    </td>
                                </tr>
                            </InsertItemTemplate>
                            <ItemTemplate>
                                <tr style="background-color: #DCDCDC; color: #000000;">

                                        <asp:Label ID="IdLabel" runat="server" Text='<%# Bind("Id") %>' Visible="false"/>

                                        <asp:Label ID="TransactionIdLabel" runat="server" 
                                            Text='<%# Eval("TransactionId") %>' Visible="false"/>
                                    <td>
                                        <asp:Label ID="CollectionTypeLabel" runat="server" 
                                            Text='<%# Eval("CollectionType") %>' />

                                    </td>
                                    <td>
                                        <asp:Label ID="CollectdateLabel" runat="server" 
                                            Text='<%# Eval("Collectdate","{0:dd-MMM-yyyy}") %>' />
                                    </td>
                                    <td>
                                        <asp:Label ID="AmountLabel" runat="server" Text='<%# Eval("Amount") %>' />
                                    </td>
                                    <td>
                                        <asp:Label ID="RemarkLabel" runat="server" Text='<%# Eval("Remark") %>' />
                                    </td>
                                    <td>
                                        <asp:Label ID="TransactorLabel" runat="server" 
                                            Text='<%# Eval("Transactor") %>' />
                                    </td>
                                    <td>
                                        <asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="Edit" />
                                        <asp:Button ID="DeleteButton" runat="server" CommandName="Delete" 
                                            Text="Delete" />
                                    </td>
                                </tr>
                            </ItemTemplate>
                            <LayoutTemplate>
                                <table runat="server">
                                    <tr runat="server">
                                        <td runat="server">
                                            <table ID="itemPlaceholderContainer" runat="server" border="1" 
                                                style="background-color: #FFFFFF;border-collapse: collapse;border-color: #999999;border-style:none;border-width:1px;font-family: Verdana, Arial, Helvetica, sans-serif;">
                                                <tr runat="server" style="background-color:#DCDCDC;color: #000000;">
                                                    <th id="Th1" runat="server">
                                                        Collect From</th>
                                                    <th runat="server">
                                                        Collect Date</th>
                                                    <th id="Th2" runat="server">
                                                        Amount</th>
                                                    <th runat="server">
                                                        Remark</th>
                                                    <th runat="server">
                                                        Transactor</th>
                                                    <th id="Th3" runat="server">
                                                        Action</th>
                                                </tr>
                                                <tr ID="itemPlaceholder" runat="server">
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                    <tr runat="server">
                                        <td runat="server" 
                                            style="text-align: center;background-color: #CCCCCC; font-family: Verdana, Arial, Helvetica, sans-serif;color: #000000">
                                        </td>
                                    </tr>
                                </table>
                            </LayoutTemplate>
                            <SelectedItemTemplate>
                                <tr style="background-color: #008A8C; font-weight: bold;color: #FFFFFF;">

                                    <td>
                                        <asp:Label ID="IdLabel" runat="server" Text='<%# Bind("Id") %>' />
                                    </td>
                                    <td>
                                        <asp:Label ID="TransactionIdLabel" runat="server" 
                                            Text='<%# Eval("TransactionId") %>' />
                                    </td>
                                    <td>
                                        <asp:Label ID="AmountLabel" runat="server" Text='<%# Eval("Amount") %>' />
                                    </td>
                                    <td>
                                        <asp:Label ID="CollectdateLabel" runat="server" 
                                            Text='<%# Eval("Collectdate","{0:dd-MMM-yyyy}") %>' />
                                    </td>
                                    <td>
                                        <asp:Label ID="CollectionTypeLabel" runat="server" 
                                            Text='<%# Eval("CollectionType") %>' />
                                    </td>
                                    <td>
                                        <asp:Label ID="RemarkLabel" runat="server" Text='<%# Eval("Remark") %>' />
                                    </td>
                                    <td>
                                        <asp:Label ID="TransactorLabel" runat="server" 
                                            Text='<%# Eval("Transactor") %>' />
                                    </td>
                                                                        <td>
                                    <asp:Button ID="DeleteButton" runat="server" CommandName="Delete" 
                                        Text="Delete" />
                                    <asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="Edit" />
                                </td>
                                </tr>
                            </SelectedItemTemplate>
                            </asp:ListView>
                        <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
                                SelectMethod="retrieve" TypeName="Impl.SaleDetailCollection" 
                                DeleteMethod="delete" InsertMethod="insert" 
                                UpdateMethod="updateCollection">
                                <InsertParameters>
                                    <asp:Parameter Name="TransactionId" Type="String" />
                                    <asp:Parameter Name="CollectionType" Type="String" />
                                    <asp:Parameter Name="Collectdate" Type="DateTime" />
                                    <asp:Parameter Name="Amount" Type="String" />
                                    <asp:Parameter Name="Remark" Type="String" />
                                    <asp:Parameter Name="transactor" Type="String" />
                                    <asp:Parameter Name="transactType" Type="String" />
                                </InsertParameters>
                                <SelectParameters>
                                    <asp:SessionParameter DefaultValue="1" Name="transactionId" SessionField="Tid" 
                                        Type="String" />
                                    <asp:Parameter DefaultValue="Sale" Name="transactType" Type="String" />
                                </SelectParameters>
                                <DeleteParameters>
                                    <asp:Parameter Name="Id" Type="String" />
                                    <asp:Parameter Name="transactType" Type="String" />
                                </DeleteParameters>
                                <UpdateParameters>
                                    <asp:Parameter Name="Id" Type="String" />
                                    <asp:Parameter Name="TransactionId" Type="String" />
                                    <asp:Parameter Name="CollectionType" Type="String" />
                                    <asp:Parameter Name="Collectdate" Type="DateTime" />
                                    <asp:Parameter Name="Amount" Type="String" />
                                    <asp:Parameter Name="Remark" Type="String" />
                                    <asp:Parameter Name="transactor" Type="String" />
                                    <asp:Parameter Name="transactType" Type="String" />
                                </UpdateParameters>
                            </asp:ObjectDataSource>
                        </tr>
                        </table>
                        <table class="General-info-table " id="Table2" cellpadding="0" cellspacing="0">
                        <tr>
                            <th scope="row" valign="top">Remark :</th>
                            <td><asp:TextBox ID="txtCollectRemark" runat="server" TextMode="MultiLine" Height="100px" /></td>
                        </tr>
                        <tr>
                            <th scope="row">Completed :</th>
                            <td>
                                <asp:CheckBox ID="chkCollectComplete" runat="server" onClick="checkVisible('Collect')" />
                                <asp:Label ID="lblCollectRemark" runat="server" Font-Size="12px" />
                            </td>
                        </tr>
                    </table>
                    </asp:Panel>
                    <asp:panel ID="pnlUndoTrans" runat="server" Visible="false">
                        <asp:Label ID="lblUndoTransaction" runat="server" Text="Undo Transaction" class="SecondaryTitle"/>
                        <table class="General-info-table" id="UndoTransaction" cellpadding="0" cellspacing="0">
                            <tr>
                                <th scope="row" style="width:250px;">Abort Date :</th>
                                <td><asp:Label ID="lblUndoDate" runat="server" Font-Size="12px" /></td>
                            </tr>
                            <tr>
                                <th scope="row">Remark(WHY) :</th>
                                <td>
                                    <asp:TextBox ID="txtRemark" runat="server" TextMode="MultiLine" Height="100px" />
                                    <span style="color: Red">*</span>
                                    <asp:RequiredFieldValidator ID="rfvtxtRemark" runat="server" ControlToValidate="txtRemark" ValidationGroup="undo" ErrorMessage="<br />*Required" Display="Dynamic" ForeColor="Red" CssClass="ErrorMsg" />
                                </td>
                            </tr>
                            <tr>
                                <th scope="row">Collected Amount :</th>
                                <td>
                                    RM<asp:TextBox ID="txtUndoCollectAmt" runat="server" onkeypress="return isNumberKey(event)" onpaste="return false;" onkeyup="checkUndoInfo()" Text="0.00" />   
                                    <span style="color: Red">*</span>
                                    <asp:RequiredFieldValidator ID="rfvtxtUndoCollectAmt" runat="server" ControlToValidate="txtCollectAmt" ValidationGroup="undo" ErrorMessage="<br />*Required" Display="Dynamic" ForeColor="Red" CssClass="ErrorMsg" />
                                </td>
                            </tr>
                            <tr id="AgencyFee" runat="server">
                                <th scope="row">Agency Fee :</th>
                                <td>
                                    RM<asp:textbox id="txtVendorAgencyFee" runat="server" onkeypress="return isNumberKey(event)" onpaste="return false;" onkeyup="Calculation()" Text="0.00" />&nbsp;+&nbsp;<asp:textbox id="txtVendorGst" runat="Server" onkeyup="Calculation()" Text="0.00" />&nbsp;% GST&nbsp;<asp:checkbox id="chkVendorGstPaid" runat="Server" text="Paid By Vendor" onkeyup="Calculation()" Font-Size="12px" />
                                    <span style="color: Red">*</span>
                                    <asp:RequiredFieldValidator ID="rfvtxtVendorAgencyFee" runat="server" ControlToValidate="txtVendorAgencyFee" ValidationGroup="undo" ErrorMessage="<br />*Required" Display="Dynamic" ForeColor="Red" CssClass="ErrorMsg" Enabled="false" />
                                </td>
                            </tr>
                            <tr id="ReferralAmt" runat="server">
                                <th scope="row">Referral Amount :</th>
                                <td>
                                    RM<asp:TextBox ID="txtVendorReferralAmt" runat="server" onkeypress="return isNumberKey(event)" onpaste="return false;" Text="0.00" />
                                    <span style="color: Red">*</span>
                                    <asp:RequiredFieldValidator ID="rfvtxtVendorReferralAmt" runat="server" ControlToValidate="txtVendorReferralAmt" ValidationGroup="undo" ErrorMessage="<br />*Required" Display="Dynamic" ForeColor="Red" CssClass="ErrorMsg" Enabled="false" />
                                </td>
                            </tr>
                            <tr id="ListingFee" runat="server">
                                <th scope="row">Listing Fee :</th>
                                <td>RM<asp:Label ID="lblListingFee" runat="server" Font-Size="12px" /><asp:Label ID="lblListingPercent" runat="server" style="display:none" /></td>
                            </tr>                            
                            <tr>
                                <td scope="row" colspan="2"  align="right">
                                <div style="border-top: 1px solid #c2c2c2; height:20px; padding-top:10px; "><asp:Button ID="btnAbort" runat="server" Text="Abort Transaction" ValidationGroup="undo" CssClass="search-btn" Width="120" />&nbsp;<asp:Button ID="btnCancelAbort" runat="server" Text="Cancel" CssClass="search-btn" Width="60" /></div>
                                </td>
                            </tr>
                        </table>
                    </asp:panel>                    
                </div>
            </td>
        </tr>
        <tr>
            <td colspan="2"></td>
        </tr>
    </table>
</div>
 <div class="Confirmation-Container">

        <table width="100%" style="margin-left:0px; margin-bottom:25px;">
                        <tr>
                            <td><div class="General-info-title-line"></div></td>
                            <td style="width:290px;"> 
                                &nbsp;<asp:Button ID="btnBack" runat="server" Text="Back" CssClass="search-btn" Width="60"/>
                                &nbsp;<asp:button ID="BtnAbortTransaction" runat="server" Text="Abort Transaction" CssClass="search-btn" Width="120"/>
                                &nbsp;<asp:Button ID="BtnSave" runat="server" Text="Save" ValidationGroup="gSave" CssClass="search-btn" Width="80"/>
                                <cc1:ConfirmButtonExtender ID="CBEBack" runat="server" TargetControlID="btnBack" />
                            
                            </td>
                            <td style="width: 60px"><div class="General-info-title-line"></div></td>
                        </tr>
                    </table>
</div>
    </div>
<asp:Label ID="lblhidAmountToCollect" runat="server" />
<script language="javascript" type="text/javascript">
 function checkUndoInfo() {
    var AgencyFee = document.getElementById('<%=AgencyFee.ClientID %>');
    var ReferralAmt = document.getElementById('<%=ReferralAmt.ClientID %>');
    var ListingFee = document.getElementById('<%=ListingFee.ClientID %>');
    var txtUndoCollectAmt = document.getElementById('<%=txtUndoCollectAmt.ClientID %>');
    var rfvtxtVendorAgencyFee = document.getElementById('<%=rfvtxtVendorAgencyFee.ClientID %>');
    var rfvtxtVendorReferralAmt = document.getElementById('<%=rfvtxtVendorReferralAmt.ClientID %>')

    if (txtUndoCollectAmt.value > 0) {
        AgencyFee.style.display = "inline";
        AgencyFee.style.visibility = "visible";
        ReferralAmt.style.display = "inline";
        ReferralAmt.style.visibility = "visible";
        ListingFee.style.display = "inline";
        ListingFee.style.visibility = "visible";
        ValidatorEnable(rfvtxtVendorAgencyFee, true);
        ValidatorEnable(rfvtxtVendorReferralAmt, true);    
    }
    else {
        AgencyFee.style.display = "none";
        AgencyFee.style.visibility = "hidden";
        ReferralAmt.style.display = "none";
        ReferralAmt.style.visibility = "hidden";
        ListingFee.style.display = "none";
        ListingFee.style.visibility = "hidden";    
        ValidatorEnable(rfvtxtVendorAgencyFee, false);
        ValidatorEnable(rfvtxtVendorReferralAmt, false);        
    }
    }
    
 function Calculation() {
    var txtVendorAgencyFee = document.getElementById('<%=txtVendorAgencyFee.ClientID %>');
    var txtVendorGst = document.getElementById('<%=txtVendorGst.ClientID %>');
    var chkVendorGstPaid = document.getElementById('<%=chkVendorGstPaid.ClientID %>');
    var lblListingFee = document.getElementById('<%=lblListingFee.ClientID %>');
    var lblListingPercent = document.getElementById('<%=lblListingPercent.ClientID %>');
    
    var GST = parseFloat(txtVendorAgencyFee.value) * (parseFloat(txtVendorGst.value) / 100);
    if (chkVendorGstPaid.checked) {
        var ListingFee = parseFloat(txtVendorAgencyFee.value) * (parseFloat(lblListingPercent.innerHTML) / 100)
        lblListingFee.innerHTML = ListingFee.toFixed(2)
    }
    else {
        var ListingFee = (parseFloat(txtVendorAgencyFee.value) - GST) * (parseFloat(lblListingPercent.innerHTML) / 100)
        lblListingFee.innerHTML = ListingFee.toFixed(2)
    }
 }
 
 function checkVisible(fieldType) {
    var rfvtxtCollectAmt = document.getElementById('<%=rfvtxtCollectAmt.ClientID %>');
    var rfvtxtCollectDate = document.getElementById('<%=rfvtxtCollectDate.ClientID %>');
    var rfvtxtSignDate = document.getElementById('<%=rfvtxtSignDate.ClientID %>');
    var rfvtxtSPDate1 = document.getElementById('<%=rfvtxtSPDate1.ClientID %>');
    var chkCollectComplete = document.getElementById('<%=chkCollectComplete.ClientID %>');
    var chkSignComplete = document.getElementById('<%=chkSignComplete.ClientID %>');
    if (fieldType=='Sign') {
        if (chkSignComplete.checked) {
            ValidatorEnable(rfvtxtSPDate1, true);
            ValidatorEnable(rfvtxtSignDate, true);
        }
        else {
            ValidatorEnable(rfvtxtSPDate1, false);
            ValidatorEnable(rfvtxtSignDate, false);
        }
    }
    else {
        if (chkCollectComplete.checked) {
            ValidatorEnable(rfvtxtCollectDate, true);
            ValidatorEnable(rfvtxtCollectAmt, true);
        }
        else {
            ValidatorEnable(rfvtxtCollectDate, false);
            ValidatorEnable(rfvtxtCollectAmt, false);
        }
    }
    }
 </script>

</asp:Content>

